<html lang="zh-cn">
<head>
{% include "tdm_include_head_template.html" %}
<meta http-equiv="refresh" content="30">
<script type="text/javascript">
</script>

</head>

<body class=" theme-blue">
{% include "tdm_include_navbar_template.html" %}

<div class="container-fluid">
  {% ifequal city "all" %}
  <div class="row">
    <div class="col-lg-12 col-sm-12 main">
      {% for city in city_summary_list %}
      <div class="col-lg-3 col-sm-4">
        <div class="panel panel-primary">
          <div class="panel-heading">
            <h3 class="panel-title">
              <a href="/tdm/main/{{city.name}}">
              {{city.name}} ({{city.obj.zipcode}})
              <div class="pull-right">
                <span class="glyphicon glyphicon glyphicon-circle-arrow-right"></span>
              </div>
              </a>
            </h3>
          </div>
          <!--
          <div class="panel-body">
            故障率统计
          </div>
          -->
          <ul class="list-group">
              <a href="/tdm/acard/{{city.name}}" class="list-group-item">
                考勤设备
                <div class="pull-right">
                  <span class="badge">{{city.ctmdev_nr}}</span>
                  <span class="badge">{{city.cardreader_nr}}</span>
                  {% if city.acard_alert_nr %}
                  <span class="badge badge-danger">{{city.acard_alert_nr}}</span>
                  {% endif %}
                  {% if city.acard_warn_nr %}
                  <span class="badge badge-warning">{{city.acard_warn_nr}}</span>
                  {% endif %}
                </div>
              </a>
              <a href="/tdm/acard/{{city.name}}" class="list-group-item">
                考勤数据
                <div class="pull-right">
                  {% if city.data_success %}
                  <span class="badge badge-success">{{city.acard_attend_yewu}}</span>
                  <span class="badge badge-success">{{city.acard_attend_core}}</span>
                  <span class="badge badge-success">{{city.acard_attend_ctm}}</span>
                  {% else %}
                  <span class="badge badge-danger">{{city.acard_attend_yewu}}</span>
                  <span class="badge badge-danger">{{city.acard_attend_core}}</span>
                  <span class="badge badge-danger">{{city.acard_attend_ctm}}</span>
                  {% endif %}
                </div>
              </a>
          </ul>
        </div>
      </div>
      {% endfor %}
    </div>
  </div>

  {% else %}

  <div class="row">
    <div class="col-lg-12 col-sm-12 main">
      <div class="col-lg-12 col-sm-12">
        <a href="/tdm/main/" rol="button" class="btn btn-primary">
          <span class="glyphicon glyphicon-circle-arrow-left"></span>
          城市 {{view_city.name}}
        </a>
      </div>
      {% for venue in venue_summary_list %}
      <div class="col-lg-3 col-sm-4">
        <div class="panel panel-primary">
          <div class="panel-heading">
            <h3 class="panel-title">
              <a href="/tdm/acard/{{city}}/{{venue.name}}">{{venue.name}}</a>
            </h3>
          </div>
          <table class="table">
            <tr>
              <td>
                工控机
                <div class="pull-right">
                  <span class="badge">{{venue.obj.ctm_devs|length}}</span>
                  {% if venue.acard_alert_nr %}
                  <span class="badge badge-danger">{{venue.acard_alert_nr}}</span>
                  {% endif %}
                </div>
              </td>
              <td>
                系统数据
                <div class="pull-right">
                  {% if venue.data_success %}
                  <span class="badge badge-success">{{venue.acard_attend_core}}</span>
                  {% else %}
                  <span class="badge badge-danger">{{venue.acard_attend_core}}</span>
                  {% endif %}
                </div>
              </td>
            </tr><tr>
            <td>
              考勤机
              <div class="pull-right">
                <span class="badge">{{venue.obj.card_readers|length}}</span>
                {% if venue.acard_warn_nr %}
                <span class="badge badge-warning">{{venue.acard_warn_nr}}</span>
                {% endif %}
              </div>
            </td>
            <td>
              工控数据
              <div class="pull-right">
                {% if venue.data_success %}
                <span class="badge badge-success">{{venue.acard_attend_ctm}}</span>
                {% else %}
                <span class="badge badge-danger">{{venue.acard_attend_ctm}}</span>
                {% endif %}
              </div>
            </td>
            </tr><tr>
            <td>
              查证PAD
              <div class="pull-right">
                <span class="badge">{{venue.obj.attend_pad|length}}</span>
              </div>
            </td>
            <td>&nbsp;</td>
            </tr>
          </table>
        </div>
      </div>
      {% endfor %}
    </div>
  </div>
  {% endifequal %}
  </div>

</body>
</html>